package cn.java75.sp.web;

import cn.java75.sp.service.GradeService;
import cn.java75.sp.vo.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author oldliu
 * @since 1.0
 */
@RestController
@RequestMapping("grade")
public class GradeController {
    @Autowired
    private GradeService gradeService;
    @GetMapping("showall")
    @PreAuthorize("hasAuthority('stushow')")
    public AjaxResult showAll(){
        try {
            Thread.sleep(2500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return AjaxResult.success(this.gradeService.findALL());
    }
}
